package com.qysoft.dtkj.dtkj_gl.services.common;

import java.util.HashMap;
import java.util.List;

import com.qysoft.rapid.dao.mybatis.RapidDao;

public class CommonService {

	/**
	 * 查询重点税源企业信息
	 * @param qylx 企业类型 0为非上市企业 1为上市企业 空为所有企业
	 * @return
	 * @throws Exception
	 */
	public static List<HashMap<String, Object>> queryQyxx(String qylx) throws Exception{
		List<HashMap<String, Object>> qyxxList = null;
		String sql = "select qyid, qymc, qyjc, qylx, ssbk, gpdm from dtkj_qyxx";
		if (qylx!=null&&!"".equals(qylx)) {
			sql += " where qylx = ?";
			qyxxList = RapidDao.queryList(sql, qylx);
		}else {
			qyxxList = RapidDao.queryList(sql);
		}
		return qyxxList;
	}
	
	/**
	 * 查询cap抓取信息
	 * @param modules
	 * @return
	 * @throws Exception
	 */ 
	public static List<HashMap<String, Object>> queryCapInfo(String modules) throws Exception{ 
		List<HashMap<String, Object>> capList = null;
		String sql = "select capid, webname, baseurl, clsname, qyscope, qhscope, modules, iscap from dtkj_capinfo";
		if (modules!=null&&!"".equals(modules)) {
			sql += " where modules like ?";
			capList = RapidDao.queryList(sql, "%"+modules+"%");
		}else {
			capList = RapidDao.queryList(sql);
		}
		return capList;
	}
	
}
